package com.tich.api.client;

import com.tich.api.domain.dto.ProgramTicketAddDTO;
import com.tich.api.domain.dto.ProgramTicketDeductDTO;
import com.tich.api.domain.vo.ProgramClientSelectVO;
import com.tich.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("program-service")
public interface ProgramClient {

    /**
     * 根据id查询节目以及门票信息
     * @param programId
     * @param ticketId
     * @return
     * */
    @GetMapping("/client/program")
    public Result<ProgramClientSelectVO> programClientSelect(@RequestParam("programId") Long programId,
                                                             @RequestParam("ticketId") Long ticketId);

    /**
     * 扣减门票数量
     * @param programTicketDeductDTO
     * @return
     * */
    @PutMapping("/client/program/ticket/deduct")
    public Result<Boolean> programTicketDeduct(@RequestBody ProgramTicketDeductDTO programTicketDeductDTO);

    /**
     * 取消订单，恢复门票库存
     * @param programTicketAddDTO
     * @return
     * */
    @PutMapping("/client/program/ticket/add")
    public Result<Boolean> programTicketAdd(@RequestBody ProgramTicketAddDTO programTicketAddDTO);

    /**
     * 查询门票种类
     * @param ticketId
     * @return
     */
    @GetMapping("/client/program/ticket/category")
    public Result<String> ticketCategorySelect(@RequestParam Long ticketId);

}
